From: Keir Fraser Date: Tue, 31 Mar 2009 10:23:38 +0000 (+0100) Subject: xend: Properly save/restore vnc/vfb configuration X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~13989^2~66 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22man:///%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22man:/?a=commitdiff_plain;h=ceb97ddf1c262ba0b237779c544511918c5240dd;p=xen.git xend: Properly save/restore vnc/vfb configuration In 19284:0942BAA2A088 provision was made for running vnc and sdl simultaneously. However, arrangements for saving and restoring the new structure-configuration, and arrangements for allowing the new code to load old savefiles, were not made. This patch adds these facilities. Amongst other things, HVM VNC save/restore will now work properly again. Signed-off-by: Ian Jackson --- diff --git a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py index 7bb6255aff..3950cca715 100644 --- a/tools/python/xen/xend/XendConfig.py +++ b/tools/python/xen/xend/XendConfig.py @@ -1410,6 +1410,21 @@ class XendConfig(dict): if dev_uuid not in target['console_refs']: target['console_refs'].append(dev_uuid) + # Cope with old-format save files which say under vfb + # (type vfb) rather than (vfb 1) + try: + vfb_type = dev_info['type'] + except KeyError: + vfb_type = None + log.debug("iwj dev_type=%s vfb type %s" % + (dev_type, `vfb_type`)) + + if vfb_type == 'vnc' or vfb_type == 'sdl': + dev_info[vfb_type] = 1 + del dev_info['type'] + log.debug("iwj dev_type=%s vfb setting dev_info['%s']" % + (dev_type, vfb_type)) + elif dev_type == 'console': if 'console_refs' not in target: target['console_refs'] = [] diff --git a/tools/python/xen/xend/server/vfbif.py b/tools/python/xen/xend/server/vfbif.py index 6f049d3c13..d1e99efb1b 100644 --- a/tools/python/xen/xend/server/vfbif.py +++ b/tools/python/xen/xend/server/vfbif.py @@ -6,7 +6,7 @@ import xen.xend import os CONFIG_ENTRIES = ['type', 'vncdisplay', 'vnclisten', 'vncpasswd', 'vncunused', - 'videoram', 'display', 'xauthority', 'keymap', + 'videoram', 'display', 'xauthority', 'keymap', 'vnc', 'sdl', 'uuid', 'location', 'protocol', 'opengl'] class VfbifController(DevController):